# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.APIGateway.V1beta.Model.ApigatewayBackendConfig do
  @moduledoc """
  Configuration for all backends.

  ## Attributes

  *   `googleServiceAccount` (*type:* `String.t`, *default:* `nil`) - Google Cloud IAM service account used to sign OIDC tokens for backends that have authentication configured (https://cloud.google.com/service-infrastructure/docs/service-management/reference/rest/v1/services.configs#backend). This may either be the Service Account's email (i.e. "{ACCOUNT_ID}@{PROJECT}.iam.gserviceaccount.com") or its full resource name (i.e. "projects/{PROJECT}/accounts/{UNIQUE_ID}"). This is most often used when the backend is a GCP resource such as a Cloud Run Service or an IAP-secured service. Note that this token is always sent as an authorization header bearer token. The audience of the OIDC token is configured in the associated Service Config in the BackendRule option (https://github.com/googleapis/googleapis/blob/master/google/api/backend.proto#L125).
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :googleServiceAccount => String.t() | nil
        }

  field(:googleServiceAccount)
end

defimpl Poison.Decoder, for: GoogleApi.APIGateway.V1beta.Model.ApigatewayBackendConfig do
  def decode(value, options) do
    GoogleApi.APIGateway.V1beta.Model.ApigatewayBackendConfig.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.APIGateway.V1beta.Model.ApigatewayBackendConfig do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
